import Koa from 'koa'
import bodyParser from 'koa-bodyparser'
import Router from 'koa-router'
import cors from '@koa/cors'

const app = new Koa()
const router = new Router()
app.use(cors())
app.use(bodyParser())

router.get('/home',async (ctx)=>{
    ctx.body='请求成功'
})

app.use(router.routes())

const port = 3000
app.listen(port)
console.log(`http://localhost:${port}`);

